The Tab View Component >Events > onEnable() |
FTabView : Event : onEnable()
Availability
Flash Player 6.
Usage
myTabListener.onEnable = function( enable, tbv
) { ... }
Parameters
enable A Boolean value indicating the new enabled state of the
component.
tbv A reference to the component which triggered
the event.
Returns
Nothing
Description
This event is triggered by the TabView whenever it is enabled or disabled with the method setEnabled, and is broadcast to all listeners. Listeners may may be subscribed to listen for the onEnable event with the addListener method. By subscribing each item of content to listen for the event, you can make them react and reflect the enabled state of the TabView.
Example
The tab_addListener.fla example file contains an example of using this method.
The following example adds listeners to the component to listen for the onEnable event.
// make the grid and form listen for the onEnable event
myTab_tbv.addListener(myGrid_dg);
myTab_tbv.addListener(myForm_mc);
// define handlers for the onEnable even
myGrid_dg.onEnable = function(enable)
{
// enable or disable the grid
this.setEnabled(enable)
}
myForm_mc.onEnable = function(enable)
{
for(var el in this)
{
// loop through all the form elements and enable / disable them
this[el].setEnabled(enable);
}
}
See also